Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix printer installation for non-utop toplevels #53

Merged
merged 2 commits into from
Dec 7, 2024

Conversation

brendanzab
Copy link
Contributor

@brendanzab brendanzab commented Nov 11, 2024

As noted in #52 (comment), it seems that #52 actually broke printing for non-utop toplevels. Inlining the functions into the module (as is done in ctypes.top), along with preloading the dependencies fixes it for both toplevels, and retains consistent formatting between them.

As an alternative to this PR, #52 could be reverted instead, and we could just live with utop being broken for now.

Turns out that adding `(modules Integer_printers)` to the dune file
broke non-utop toplevels, resulting in the printers not getting
registered. Inlining the printers in the installation module (in the
style of ctypes-top) seems to fix the issue.
@brendanzab brendanzab force-pushed the fix-printer-installation branch from 8482eb2 to b38b455 Compare November 11, 2024 21:51
@brendanzab
Copy link
Contributor Author

I’ve noticed that printers are not installed for Int, Int32, Int64, and UInt. I’d imagine this is to prevent overriding the built in printers? But this results in inconsistent printing between these types and the other integer types. Have you consided switching to pp for all of the integer types, as opposed to putting them inside angle brackets?

@brendanzab
Copy link
Contributor Author

Argh, well it seems like the API I was trying to use to detect utop was introduced in 4.13.x 😔

@yallop yallop force-pushed the fix-printer-installation branch from e41d68b to 866ae74 Compare December 7, 2024 16:31
@yallop
Copy link
Owner

yallop commented Dec 7, 2024

Thank you for the fix, @brendanzab!

@yallop yallop merged commit c62b16f into yallop:master Dec 7, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants